package net;

public class Connection {
	public Connection(java.net.Socket socket) throws java.io.IOException {
		this.socket = socket;
		out = new java.io.PrintWriter(socket.getOutputStream(), true);
		in = new java.io.BufferedReader(new java.io.InputStreamReader(socket.getInputStream()));
	}

	public void println(String s) {
		out.println(s);
	}

	public void println(int i) {
		println(Integer.toString(i));
	}

	public void println() {
		println("");
	}

	public String readLine() throws java.io.IOException {
		return in.readLine();
	}

	public java.net.Socket socket() {
		return socket;
	}

	public java.io.PrintWriter out() {
		return out;
	}

	public java.io.BufferedReader in() {
		return in;
	}
	
	public boolean isConnected() {
		return socket.isBound();
	}

	private final java.net.Socket socket;
	private final java.io.PrintWriter out;
	private final java.io.BufferedReader in;
}
